package com.lyz.staticdemo;

import java.util.ArrayList;

/**
 * @ClassName D6_StaticCodeTest3
 * @Description 扑克牌案例
 * @Author 2214361854
 * @Date 2022/2/17 23:12
 * @Version 1.0
 */
public class D6_StaticCodeTest3 {
    /**
     * 容器，用于存储54张牌
     */
    public static ArrayList<String> cards = new ArrayList<>();

    /**
     * 初始化牌
     */
    static {
        //定义牌的花色与点数
        String[] colors = {"♥","♠","♣","♢"};
        String[] sizes = {"3","4","5","6","7","8","9","10","J","Q","K","A","2"};
        for (int i = 0; i < sizes.length; i++) {
            for (int j = 0; j < colors.length; j++) {
                //添加基本牌
                cards.add(sizes[i]+colors[j]);
            }
        }
        //添加大王与小王
        cards.add("大王");
        cards.add("小王");
    }

    public static void main(String[] args) {
        System.out.println("新牌"+cards);
    }
}
